package cn.flkj.evidence;

import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.security.Key;
import java.security.KeyStore;
import java.security.SignatureException;
import java.security.interfaces.ECPrivateKey;
import java.util.*;

import lombok.extern.log4j.Log4j2;
import org.fisco.bcos.channel.client.P12Manager;
import org.fisco.bcos.channel.client.Service;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;

import cn.flkj.evidence.sample.EvidenceData;
import cn.flkj.evidence.sample.PublicAddressConf;
import cn.flkj.evidence.util.Tools;
import cn.flkj.evidence.web3j.Evidence;
import cn.flkj.evidence.web3j.EvidenceSignersData;
import org.fisco.bcos.web3j.crypto.gm.GenCredential;
import org.fisco.bcos.web3j.tuples.generated.Tuple7;
import org.fisco.bcos.web3j.tx.gas.StaticGasProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.fisco.bcos.web3j.abi.datatypes.Address;
import org.fisco.bcos.web3j.crypto.Credentials;
import org.fisco.bcos.web3j.crypto.ECKeyPair;
import org.fisco.bcos.web3j.crypto.Keys;
import org.fisco.bcos.web3j.crypto.Sign;
import org.fisco.bcos.web3j.protocol.Web3j;
import org.fisco.bcos.web3j.protocol.channel.ChannelEthereumService;
import org.fisco.bcos.web3j.protocol.core.methods.response.TransactionReceipt;
import org.springframework.stereotype.Component;

@Component
@Log4j2
public class Runner implements CommandLineRunner {

    private final EvidenceImpl impl;

    public Runner(EvidenceImpl impl) {
        this.impl = impl;
    }

    @Override
    public void run(String... args) throws Exception {
        //System.out.println("-------------------------- WEB3J INIT OK !!! --------------------------");
        impl.experience();
    }





}
